<script>
	$(function () {
		$("#delOrder").click(function () {
			let orderid = $("#orderid").val();
			$.ajax({
				type: "post",
				url: "/order",
				data: "opr=del&oid=" + orderid,
				dataType: "json",
				beforeSend: function (r) {
					//加载层-默认风格
					layer.load();
				},
				success: function (result) {
					if (result.msg == 'ok') {
						layer.alert("取消成功", function (index) {
							window.location.href = "/ucenter/index.html";
						});
					} else {
						layer.msg(result.msg, { icon: 2 });
					}
				},
				complete: function (XMLHttpRequest, textStatus) {
					// alert('远程调用成功，状态文本值：'+textStatus);
					layer.closeAll('loading');
				},
				error: function () {
					layer.msg('系统繁忙，请稍后再试', { icon: 2 });
				}
			})
		}),
			// 确认收货
			$("#confirmOrder").click(function () {
				let orderid = $("#orderid").val();
				$.ajax({
					type: "post",
					url: "/order",
					data: "opr=confirm&oid=" + orderid,
					dataType: "json",
					beforeSend: function (r) {
						//加载层-默认风格
						layer.load();
					},
					success: function (result) {
						if (result.msg == 'ok') {
							layer.msg("确认成功", { icon: 1 });
							$("#status").text("已完成");

						} else {
							layer.msg(result.msg, { icon: 2 });
						}
					},
					complete: function (XMLHttpRequest, textStatus) {
						// alert('远程调用成功，状态文本值：'+textStatus);
						layer.closeAll('loading');
					},
					error: function () {
						layer.msg('系统繁忙，请稍后再试', { icon: 2 });
					}
				})
			})
	})
</script>

<div class="uc_title m_10">
	<label class="current"><span>订单详情</span></label>
</div>
<div class="prompt_2 m_10">
	<p>
		<b>订单号：</b><span id="orderNo"></span><b>下单日期：</b> <span id="orderTime"></span>
		<b>状态：</b> <span class="red2" id="status"></span>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<a href="javascript:viod(0)" id="delOrder">取消订单</a>
		<a href="javascript:viod(0)" id="confirmOrder">确认收货</a>
	</p>
	<p id="order_opr">

	</p>
</div>
<div class="box m_10">
	<div class="title">
		<h2>
			<span class="orange">收件人信息</span>
		</h2>
	</div>

	<!--收获信息展示-->
	<div class="cont clearfix" id="acceptShow">
		<table class="dotted_table f_l" width="100%" cellpadding="0" cellspacing="0">
			<input type="hidden" id="orderid" value="">
			<col width="130px" />
			<col />
			<tr>
				<th>收货人：</th>
				<td id="accept"></td>
			</tr>
			<tr>
				<th>地址：</th>
				<td id="address"></td>
			</tr>
			<tr>
				<th>手机号码：</th>
				<td id="telphone"></td>
			</tr>
		</table>
	</div>
</div>

<!--支付和配送-->
<div class="box m_10">
	<div class="title">
		<h2>
			<span class="orange">支付及配送方式</span>
		</h2>
	</div>
	<div class="cont clearfix">
		<table class="dotted_table f_l" width="100%" cellpadding="0" cellspacing="0">
			<col width="130px" />
			<col />
			<tr>
				<th>支付方式：</th>
				<td id="paytype"></td>
			</tr>
		</table>
	</div>
</div>

<!--物品清单-->
<div class="box m_10">
	<div class="title">
		<h2>
			<span class="orange">商品清单</span>
		</h2>
	</div>
	<div class="cont clearfix">
		<table class="list_table f_l" width="100%" cellpadding="0" cellspacing="0">
			<thead>
				<tr>
					<th>图片</th>
					<th>商品名称</th>
					<th>商品价格</th>
					<th>商品数量</th>
					<th>小计</th>
				</tr>
			</thead>
			<tbody id="orderItems">
			</tbody>
		</table>

	</div>
</div>

<div class="gray_box">

	<p>
		订单支付金额：<span class="red2">￥<label id="order_amount"></label>&nbsp;&nbsp;&nbsp;</span>
	</p>
</div>